package com.coderlin.service;

import com.coderlin.entities.Worker;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <Description> <br>
 *
 * @author Coder_Lin<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2021/07/23 16:58 <br>
 * @see com.coderlin.service <br>
 */
public interface WorkerService {
    /**
     * 列出所有的Worker
     * @return
     */
    List<Worker> listWorker();

    /**
     * 列出经过模糊查询的Worker
     * @param workerName
     * @return
     */
    List<Worker> searchWorker(@Param("workerName") String workerName);

    /**
     * 根据ID查找Worker
     * @param wid
     * @return
     */
    Worker searchWorkerById(@Param("wid") int wid);

    /**
     * 添加工人
     * @param worker
     * @return
     */
    Integer addWorker(@Param("worker") Worker worker);

    /**
     * 根据ID删除工人
     * @param wid
     * @return
     */
    Integer delWorkerById(@Param("wid") int wid);

    /**
     * 根据传入参数，对数据进行修改
     * @param worker
     * @return
     */
    Integer modWorker(Worker worker);

    /**
     * 异步更新worker工资数据
     * @param wid
     * @param workerSalary
     * @return
     */
    Integer adjustSalary(Integer wid, Integer workerSalary);

}
